﻿<%@page import="com.hhit.collaborative_learning.entity.SearchResult"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@page import="com.hhit.collaborative_learning.dao.impl.PublicDaoImplMySql"%>
<%@ page contentType="text/html; charset=utf-8" language="java"
	import="java.sql.*" errorPage=""%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	PublicDaoImplMySql dao=new PublicDaoImplMySql();
	HashMap<String,ArrayList<SearchResult>> map=dao.getHomeData();
	request.setAttribute("map", map);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<%=basePath%>css/home.css" rel="stylesheet">
	<style type="text/css">
.blog_commend .tit1 {
	border-bottom: 1px solid #c82329;
	color: #555;
	display: inline-block;
	font-size: 12px;
	height: 16px;
	padding: 0 0px 0 20px;
}
.blog_commend .tit3 {
	color: #555;
	display: inline-block;
	font-size: 12px;
	height: 16px;
	padding: 0 0px 0 0px;
}

.blog_commend UL::after {
	clear: both;
	content: ".";
	display: block;
	height: 0;
	visibility: hidden;
}

.blog_commend UL {
	padding: 10px;
	width: 100%;
}

.blog_commend LI {
	background: url("css/images/point_2.gif") no-repeat scroll 0 center
		rgba(0, 0, 0, 0);
	display: inline-block;
	float: left;
	text-align: left;
	font-size: 14px;
	height: 24px;
	overflow: hidden;
	padding-left: 7px;
	text-overflow: ellipsis;
	white-space: nowrap;
}
A {
    color: #000;
}
</style>
</head>

<body style="background: url('css/images/background.jpg') no-repeat;">

	<div class="blog_commend"
		style="position: fixed;top: 50%;left: 0;width: 24%;margin-right:1%;bottom: 0px;">
		<h3 style="text-align: left;">
			<b class="tit1" style="">最新博客</b>
			<b class="tit3" style=""><a href="<%=basePath %>learning/learning.jsp" target="_top" style="margin-left: 170px;">更多>></a></b>
		</h3>
		<ul>
			<c:forEach items="${map['blog']}" var="blog">
				<li><a target="_blank"
					href="<%=basePath%>learning/article.jsp?blogId=${blog.reId}&userId=${blog.reEditorId}">${blog.reTitle}
				</a></li>
			</c:forEach>
		</ul>
	</div>
	<div class="blog_commend"
		style="position: fixed;top: 50%;left: 25%;width: 24%;margin-right:1%;bottom: 0px;">
		<h3 style="text-align: left;">
			<b class="tit1" style="">最新帖子</b>
			<b class="tit3" style=""><a href="<%=basePath %>" target="_top" style="margin-left: 170px;">更多>></a></b>
		</h3>
		<ul>
			<c:forEach items="${map['bbs']}" var="blog">
				<li><a target="_blank"
					href="<%=basePath%>learning/article.jsp?topic={id:'${blog.reId}'}">${blog.reTitle}
				</a></li>
			</c:forEach>
		</ul>
	</div>
	<div class="blog_commend"
		style="position: fixed;top: 50%;left: 50%;width: 24%;margin-right:1%;bottom: 0px;">
		<h3 style="text-align: left;">
			<b class="tit1" style="">最新问答</b>
			<b class="tit3" style=""><a href="<%=basePath %>questions/questions.jsp" target="_top" style="margin-left: 170px;">更多>></a></b>
		</h3>
		<ul>
			<c:forEach items="${map['question']}" var="blog">
				<li><a target="_blank"
					href="<%=basePath%>questions/questionDetail.jsp?questionId=${blog.reId}">${blog.reTitle}
				</a></li>
			</c:forEach>
		</ul>
	</div>
	<div class="blog_commend"
		style="position: fixed;top: 50%;left: 75%;width: 24%;margin-right:1%;bottom: 0px;">
		<h3 style="text-align: left;">
			<b class="tit1" style="">最新资源</b>
			<b class="tit3" style=""><a href="<%=basePath %>download/download.jsp" target="_top" style="margin-left: 170px;">更多>></a></b>
		</h3>
		<ul>
			<c:forEach items="${map['data']}" var="blog">
				<li><a target="_blank"
					href="<%=basePath%>download/downloadpage.jsp?dataId=${blog.reId}">${blog.reTitle}
				</a></li>
			</c:forEach>
		</ul>
	</div>
</body>
</html>
